Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: annotate errors returned from NewFromStat() with the file path #5657

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

fiam
Copy link
Contributor

@fiam fiam commented Jan 14, 2025

Otherwise it is very tricky to understand which file produced the error.
Should help with docker/for-win#14083

@@ -46,7 +47,7 @@ func NewFromStat(stat *fstypes.Stat) (hash.Hash, error) {
fi := &statInfo{stat}
hdr, err := tar.FileInfoHeader(fi, stat.Linkname)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "failed to stat file %s", stat.Path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"failed to checksum file" (or hash), as this error may not come from stat.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks! I've updated it, PTAL.

@crazy-max crazy-max added this to the v0.19.0 milestone Jan 15, 2025
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you squash commits please? Otherwise LGTM

@fiam fiam force-pushed the alberto/annotate-new-from-stat-error branch from 4267454 to 3e41eee Compare January 15, 2025 11:31
@fiam
Copy link
Contributor Author

fiam commented Jan 15, 2025

can you squash commits please? Otherwise LGTM

Sure, thanks! I've squased them into a single commit. PTAL

Otherwise it is very tricky to understand which file produced the error.
Should help with docker/for-win#14083

Signed-off-by: Alberto Garcia Hierro <[email protected]>
@fiam fiam force-pushed the alberto/annotate-new-from-stat-error branch from 3e41eee to 8d83d36 Compare January 15, 2025 11:42
@crazy-max crazy-max merged commit a617d0e into moby:master Jan 15, 2025
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants